#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import functools, time
def log(func):
     @functools.wraps(func)
     def wrapper(*arg,**kw):
         print('call %s()' % func.__name__)
         return func(*arg,**kw)
     return wrapper
def log1(text):
    def decorator(func):
         @functools.wraps(func)
         def wrapper(*arg,**kw):
             print('%s call %s()' % (text,func.__name__))
             return func(*arg,**kw)
         return wrapper
    return decorator
@log1('wangkaixuan')
def now():
    print('test---')
# @log
# def now():
#     print('test---')

# now()

def log_run_time(func):
    @functools.wraps(func)
    def wrapper(*arg,**kw):
        start = time.time()
        print('run times=%s()' % ((time.time() - start)*1000))
        return func(*arg,**kw)
    return wrapper

@log_run_time
def test_run_time():
    print('__test run time__')
    print('__test run time__')
    print('__test run time__')

test_run_time()
